home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / STRPBRK.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  573 b   |  30 lines

  1. /* strpbrk.c  From TC Bible page 295  Use strpbrk to locate the first
  2. occurrence of any of the characters from one string in another string */
  3.  
  4. #include <stdio.h>
  5. #include <string.h>
  6. char *vowels = "aeiou";
  7. main()
  8. {
  9.     char str1[80], *result;
  10.     printf("Enter a word: ");
  11.     gets(str1);
  12.     if ((result = strpbrk(str1, vowels)) == NULL)
  13.     {
  14.         printf("No vowels in word\n");
  15.     }
  16.     else
  17.     {
  18.         printf("First syllable in %s", str1);
  19.         result++;     /* Put a null character just after the first vowel */
  20.         *result = '\0';
  21.         printf("is: %s\n", str1);
  22.     }
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29. }
  30.